package com.oj;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;

@Slf4j
@SpringBootApplication
@ServletComponentScan

public class OJApplication {
    public static void main(String[] args) {
        SpringApplication.run(OJApplication.class,args);
        log.info("项目启动成功...");
    }



    @Bean
    public CommandLineRunner printSwaggerAndKnife4jUrls() {
        return args -> {
            String swaggerUrl = "http://localhost:8080/swagger-ui.html";
            String knife4jUrl = "http://localhost:8080/doc.html";
            String message = String.format("Swagger: %s, Knife4j: %s", swaggerUrl, knife4jUrl);
            LoggerFactory.getLogger(OJApplication.class).info(message);
        };
    }
}

